package com.xyzm.springcloud.springconsumer.controller;

import com.xyzm.springcloud.springconsumer.service.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message")
public class MessageController {
    @Value("${consumer}")
    String conStr;
    @Autowired
    ProviderService providerService;

    @RequestMapping("/hello")
    public String hello() {
        String hello = providerService.hello();
        return hello + ",and this is " + conStr;
    }
}
